/**
 * Copyright (c) 2009 Collaborative Development Group, C.S. Dept., University of Bari
 *
 * All rights reserved. This program and the accompanying materials are made available under
 * the terms of the Eclipse Public License v1.0  which accompanies this distribution, and is 
 * available at http://www.eclipse.org/legal/epl-v10.html
 */
package it.uniba.di.cdg.penelope.events;


/**
 * Collection of shared utilities methods for managing events.
 */
public class Utilities {
	/**
	 * Convert a class type to an OSGI-compliant topic id.
	 * @param type
	 * @return the topic id
	 * @throws IllegalArgumentException if type is <code>null</code>
	 */
	public static String getTopicId( Class<?> type ) {
		if (type == null) {
			throw new IllegalArgumentException();
		}
		return type.getName().replace( ".", "/" );
	}
}
